package day02.work04;

public class Cylinder extends Circle{
    private double height;

    public Cylinder(){}
    public Cylinder(double radius,double height){
        super(radius);
        this.height=height;
    }

    //新增体积
    public double volume(){
        double v=0;
        v=super.surfaceArea()*height;
        return v;
    }

    //重写功能
    //表面积
    public double surfaceArea(){
        double area=0;
        area=super.surfaceArea()*2+super.periMater()*height;
        return area;
    }
    //重写toString方法
    @Override
    public String toString() {
        return "Cylinder [height=" + height + ", radius="+super.getRadius()+", volume()=" + volume() + ", surfaceArea()=" + surfaceArea() + "]";
    }
    
}
